﻿using System;
using System.Windows;



namespace Saral.ShowMessage
{
    /// <summary>
    /// Simplest implementation of <see cref="IMessageDisplay"/> which enable dispaly of MessageBox to the user.
    /// </summary>
    /// <remarks>
    /// For advance scenarios it can be customized as per the specific requirement
    /// </remarks>
    public class MessageDisplay :IMessageDisplay
    {

        /// <summary>
        /// Presents message
        /// </summary>        
        /// <param name="message">message to be displayed</param>
        public void ShowMessage(string message)
        {
            MessageBox.Show(message, Application.Current.MainWindow.Title, MessageBoxButton.OK, MessageBoxImage.None);
        }

        /// <summary>
        /// Presents warning message
        /// </summary>        
        /// <param name="message">message to be displayed</param>
        public void ShowWarning(string message)
        {
            MessageBox.Show(message, Application.Current.MainWindow.Title, MessageBoxButton.OK, MessageBoxImage.Warning);
        }

        /// <summary>
        /// Presents error message
        /// </summary>
        /// <param name="message">message to be displayed</param>
        public void ShowError(string message)
        {
            MessageBox.Show(message, Application.Current.MainWindow.Title, MessageBoxButton.OK, MessageBoxImage.Error);
        }

    }
}
